Update Rust crate uniffi to 0.32.0#108
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
e12777a to
02441b0
Compare
02441b0 to
7729fc5
Compare
7729fc5 to
a0a1055
Compare
a0a1055 to
84dca2f
Compare
84dca2f to
f60de49
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.30.0→0.32.0Release Notes
mozilla/uniffi-rs (uniffi)
v0.32.0Compare Source
Previously these languages skipped the constructor in this case or generated a constructor that always threw.
You can get similar behavior by adding the primary constructor to the uniffi.toml excludes list in uniffi.toml (e.g. `excludes = ["MyObject.new"])
--configflag now expects a global config filerather than a flat
uniffi.toml-style override. Old-style files will produce a warning and be ignored.See #2866
[ByRef] bytesUDL arguments now map to&[u8]on the Rust side instead of&Vec<u8>. UDL-defined functions whose Rust implementations take&Vec<u8>must change to&[u8]. Proc-macro signatures (fn foo(x: &[u8])) are unchanged. On the Kotlin side, call sites must now pass a directjava.nio.ByteBufferrather thanByteArray; migrate withByteBuffer.allocateDirect(arr.size).put(arr).flip(). Swift (Data) and Python (bytes) call sites are unchanged. (#2878)need to be reworked as well. See #2787 for
examples of how this can be done.
What's Fixed
UniFfiTagfromclippy::exhaustive_structssince downstream projects may depend on it #2809GlobalConfigstruct for managing config. It replacesBindgenPathsLayer::get_config()method which has been removed. See #2866.[ByRef] bytesarguments now travel across the FFI as aForeignBytes(pointer + length) value rather than aRustBuffer. External bindings need to accept the foreign-language byte buffer at the call site and lower it toForeignBytesfor the duration of the call (no copy). (#2878)What's New?
Global config file support via
--config. See the docs.Traits can now be exported with
#[uniffi::export(foreign)]for foreign-only implementations, or#[uniffi::export(rust, foreign)]for both Rust and foreign implementations. Thewith_foreignflag is deprecated in favor ofrust, foreign.Recursive enums are now supported. UniFFI automatically detects when enum and record types participate in cycles — self-referential, mutually recursive, or cycling through a record — and generates appropriate bindings:
indirectin Swift, forward references in Python (#2834).Box<T>now automatically implements FFI traits whenTimplements them, allowing direct use in enum variants and function parameters without NewType wrappers (#2808)Record fields can now be renamed with the proc-macro
name = "new_field_name"attribute (#2794)Items can be excluded from the generated bindings using
uniffi.toml.Added
mutable_recordsconfiguration option to allow specific records to remain mutable even whengenerate_immutable_recordsis enabled (Kotlin and Swift).Kotlin objects now have an
uniffiIsDestroyedproperty that returnstrueif the Rust reference no longer exists (#2825)Updated
askamaversion to0.15.6Custom Types can have docstrings in some languages (#2853)
Ruby: Expose standard Rust traits for generated ruby code (#2883)
Ruby: Add support for sync foreign traits (#2916)
Ruby: Add async support (#2923)
Added zero-copy transfer of
&[u8]/[ByRef] bytesarguments from foreign code to Rust. Kotlin (java.nio.ByteBuffer, must be direct), Swift (Data), and Python (bytes-like, buffer protocol) pass byte buffers as pointer + length (ForeignBytes) rather than copying throughRustBuffer. Not yet supported on Ruby, and not yet supported in async functions on any language (#2878).#[uniffi::export(async_runtime = "tokio")]can now be applied to trait exports, wrapping each method's FFI scaffolding future inasync_compat::Compatthe same way it does for inherent impls and free functions (#2899).Added support for using
HashSetwith proc-macrosAllow literal number suffix with
derive(uniffi::Enum)(#2926)All changes in v0.32.0.
v0.31.2Compare Source
What's Fixed
u8/u16return values by widening the internal return carrier toInt, which avoids signedness mismatches during checksum validation and other direct-return paths on Android ARM32. (#2897)FfiConverterStringsilently stripping a leading U+FEFF byte order mark from Rust strings.All changes in v0.31.2.
v0.31.1Compare Source
What's Fixed
u8/u16return values by widening the internal return carrier toInt, which avoids signedness mismatches during checksum validation and other direct-return paths on Android ARM32. (#2897)FfiConverterStringsilently stripping a leading U+FEFF byte order mark from Rust strings.All changes in v0.31.2.
v0.31.0Compare Source
What's Fixed
#2821
#2854
All changes in v0.31.1.
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.